package cloud.daodao.storm.common.user.model.rbac;

import cloud.daodao.storm.common.serialize.Serializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * @author DaoDao
 */
@Data
@Schema(title = "UserRoleUpsert", description = "修改用户角色")
public class UserRoleUpsert implements Serializer {

    @Schema(title = "userId", description = "用户 id", example = "1")
    @NotNull
    @Min(value = 1)
    @Max(value = Long.MAX_VALUE)
    private Long userId;

    @Schema(title = "roleId", description = "角色 id", example = "1")
    @NotNull
    @Min(value = 1)
    @Max(value = Long.MAX_VALUE)
    private Long roleId;

    @Schema(title = "valid", description = "是否有效，如果置为有效，则会将本参数对象中的 用户 id 和 角色 id 组成关联关系，并设置为有效，即赋予用户这个角色。反之无效，则取消这个角色。", example = "true")
    @NotNull
    private Boolean valid;

}
